package oocl.com.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import oocl.com.dao.CustomerDao;
import oocl.com.dao.impl.CustomerDaoImpl;
import oocl.com.pojo.Customer;
import oocl.com.service.CustomerManager;

public class CustomerManagerImplMock implements CustomerManager {
	private List<Customer> list = new ArrayList<Customer>();
	private CustomerDao dao;
	
	public CustomerManagerImplMock() {
		dao = new CustomerDaoImpl();
		Customer c = new Customer(null, "jordan", 11.2, true, new Date(), new String[]{"footboll", "basket"});
		list.add(c);
	}

	@Override
	public int addCustomer(Customer c) {
		int m = dao.addCustomer(c);
		list.add(c);
		return m;
	}

	@Override
	public List<Customer> findAllCustomer() {
		List<Customer> list = dao.findAllCustomer();
		return list;
	}

	@Override
	public int deleteCustomer(int id) {
		int m = dao.deleteCustomer(id);
		return m;
	}

	@Override
	public int updateCustomer(Customer c) {
		int m = dao.updateCustomer(c);
		return m;
	}

	@Override
	public Customer loadCustomer(int id) {
		Customer c = dao.loadCustomer(id);
		return c;
	}

}
